<script setup lang="ts">
import GlobalHeader from "../../components/GlobalHeader.vue";
import FeaturedCard from "./components/FeaturedCard.vue";
import SimpleCard from "../../components/SimpleCard.vue";

// 精选计划数据
const featuredPlans = [
  {
    title: '动态规划（基础版）',
    description: '更细致的知识点讲解，让入门更简单',
    gradient: 'linear-gradient(rgb(75, 143, 78) 0%, rgb(20, 71, 56) 100%)',
    imageUrl: 'https://pic.leetcode.cn/1690881907-DNkYrg-Dynamic%20Programming%20%F0%9F%91%8C@3-240x240.png'
  },
  {
    title: '高频 SQL 50 题（基础版）',
    description: '数据库面试必会基础知识点全覆盖',
    gradient: 'linear-gradient(rgb(25, 118, 210) 0%, rgb(12, 50, 89) 100%)',
    imageUrl: 'https://pic.leetcode.cn/1690881907-Vtaqrl-Top%20SQL%2050%20%F0%9F%91%8C@3-240x240.png'
  },
  {
    title: 'LeetCode 热题 100',
    description: '力扣最受欢迎必会经典题目',
    gradient: 'linear-gradient(rgb(156, 39, 176) 0%, rgb(65, 16, 73) 100%)',
    imageUrl: 'https://pic.leetcode.cn/1690881907-oVEPdc-Top%20100%20Liked%20%F0%9F%91%8C@3-240x240.png'
  },
  {
    title: '编程基础 0 到 1',
    description: '50 道零基础编程能力题',
    gradient: 'linear-gradient(rgb(233, 30, 99) 0%, rgb(117, 15, 50) 100%)',
    imageUrl: 'https://pic.leetcode.cn/1690881907-yxAHCB-Programming%20Skills%F0%9F%91%8C@3-240x240.png'
  }
]

// 修改面试准备计划数据结构，添加imageUrl
const interviewPlans = [
  {
    title: '面试经典 150 题',
    description: '最经典 150 题，掌握面试所有知识点',
    imageUrl: 'https://assets.leetcode.cn/aliyun-lc-upload/study_plan_v2/top-interview-150/cover'
  },
  {
    title: 'LeetCode 75',
    description: '面试必考精华版，75 题覆盖全套考点',
    imageUrl: 'https://assets.leetcode.cn/aliyun-lc-upload/study_plan_v2/leetcode-75/cover'
  },
  {
    title: '高频 SQL 50 题（基础版）',
    description: '数据库面试必会基础知识点全覆盖',
    imageUrl: 'https://pic.leetcode.cn/1690881907-Vtaqrl-Top%20SQL%2050%20%F0%9F%91%8C@3-240x240.png'
  },
  {
    title: '高频 SQL 50 题（进阶版）',
    description: '面试考点全覆盖高阶数据库面试',
    imageUrl: 'https://assets.leetcode.cn/aliyun-lc-upload/study_plan_v2/sql-premium-50/cover'
  },
  {
    title: 'LeetCode 热题 100',
    description: '力扣最受欢迎必会经典题目',
    imageUrl: 'https://pic.leetcode.cn/1690881907-oVEPdc-Top%20100%20Liked%20%F0%9F%91%8C@3-240x240.png'
  }
]
</script>

<template>
  <GlobalHeader/>
  <div class="container">
    <div class="study-plan-container">
      <div class="header-section">
        <h1 class="main-title">学习计划</h1>
        <el-button type="primary" plain>我的学习计划 »</el-button>
      </div>

      <div class="section">
        <h2 class="section-title">精选</h2>
        <div class="featured-grid">
          <FeaturedCard
            v-for="plan in featuredPlans"
            :key="plan.title"
            v-bind="plan"
          />
        </div>
      </div>

      <div class="section">
        <h2 class="section-title">面试准备·全面通关</h2>
        <div class="interview-grid">
          <SimpleCard
            v-for="plan in interviewPlans"
            :key="plan.title"
            v-bind="plan"
          />
        </div>
      </div>
    </div>
  </div>

</template>

<style scoped>
.container {
  background-color: #f5f5f5;
}

.study-plan-container {
  max-width: 1024px;
  padding: 56px 24px 0 24px;
  margin: 0 auto;
  min-height: 100vh;
}

.header-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.main-title {
  font-size: 32px;
  font-weight: 600;
  color: #1a1a1a;
}

.section {
  margin-bottom: 48px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 56px 4px 24px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.interview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

@media (max-width: 1024px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .interview-grid {
    grid-template-columns: 1fr;
  }
}
</style>